package com.example.demospringmybatisplus.mapper;

import java.util.List;
import java.util.Set;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demospringmybatisplus.vo.NodeVo;

/**
 * NodeMapper
 *
 * @author huahua
 * @DATE 2024/5/3
 **/
@DS("mysql1")
@Repository("NodeMapper")
public interface NodeMapper extends BaseMapper<NodeVo> {
    @Select("select distinct esn from node_vo where name like 'GTS5900%'")
    List<String> getNodeListByName(String name);

    @Select("select esn from node_vo where name like 'GTS5900%'")
    Set<String> getNodeSetByName(String name);

    @Select("select esn from node_vo where name like 'GTS5900%'")
    List<String> getNodeListNoDistinctByName(String name);

    @Select("select esn from node_vo where esn like 'msk00%' and name != ''")
    List<NodeVo> getNodeListNoEmptyNameByEsn(String esn);

    @Select("select esn from node_vo where esn like 'msk00%'")
    List<NodeVo> getNodeListByEsn(String esn);

    @Select("select distinct esn from node_vo")
    List<String> getNodeList();
}
